<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path;
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<title>抽奖</title>
<meta name="viewport"
	content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<meta charset="utf-8" />
<link href="<%=basePath%>/css/sweetalert.css" rel="stylesheet" />
<link href="<%=basePath%>/css/idangerous.swiper.css" rel="stylesheet" />
<link href="<%=basePath%>/css/skin.css" rel="stylesheet" />
<link href="<%=basePath%>/css/lottery.css" rel="stylesheet" />

<script type="text/javascript" src="<%=basePath%>/js/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/lottery.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/idangerous.swiper-2.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>/js/sweetalert.min.js"></script>
<style>
body{
    background: #aaa;
    }
h1{
	margin-top:20px;
	color:
}
</style>
</head>
<body>
<div class="turnplate_box">
	<canvas id="myCanvas" width="300px" height="300px">抱歉！浏览器不支持。</canvas>
	<canvas id="myCanvas01" width="200px" height="200px">抱歉！浏览器不支持。</canvas>
	<canvas id="myCanvas03" width="200px" height="200px">抱歉！浏览器不支持。</canvas>
	<canvas id="myCanvas02" width="150px" height="150px">抱歉！浏览器不支持。</canvas>
	<button id="tupBtn" class="turnplatw_btn"></button>
</div>
<div style="width:100%">
	<p>
		
	</p>
</div>
<!-- 更改系统默认弹窗 -->
<script type="text/javascript">
var result = {
	num:Number('${lottery.lotterytype}'),
	name:'${lottery.lotteryname}',
	id:'${lottery.id}'
}
swal({   
	title: "填写联系方式",   
	text: "填写联系方式后进行抽奖",   
	type: "input",    
	closeOnConfirm: false,      
	inputPlaceholder: "联系电话" 
	}, 
	function(inputValue){   
		if (inputValue === false) return false;      
		if (inputValue === "") {    
			swal.showInputError("请填写联系电话，方便工作人员与您联系");     
			return false   
			}   
		$.ajax({
			type : "POST",
			url : "<%=basePath%>/voteLotteryMobile.htm",
			data : {
				id : result.id,
				mobile : inputValue
			},
			beforeSend : function() {
				swal('提交中');
			},
			success : function(data) {
				if (data=="success") {
					swal('提交成功');
				} else {
					swal('提交失败，请检查网络');
				}
			},
			error : function() {
				swal('提交失败，请检查网络');
			}
		})
	}
);


window.alert = function(str)
{
	swal({
		title :	str,
		confirmButtonText:"回到首页",
		showCancelButton : true,
		cancelButtonText : "取消"
	}
	,function(){   
		//确认后刷新
		window.location.href="<%=basePath %>/vote.htm";
	});
	/* var shield = document.createElement("DIV");
	shield.id = "shield";
	shield.style.position = "absolute";
	shield.style.left = "50%";
	shield.style.top = "50%";
	shield.style.width = "280px";
	shield.style.height = "150px";
	shield.style.marginLeft = "-140px";
	shield.style.marginTop = "-110px";
	shield.style.zIndex = "25";
	var alertFram = document.createElement("DIV");
	alertFram.id="alertFram";
	alertFram.style.position = "absolute";
	alertFram.style.width = "280px";
	alertFram.style.height = "150px";
	alertFram.style.left = "50%";
	alertFram.style.top = "50%";
	alertFram.style.marginLeft = "-140px";
	alertFram.style.marginTop = "-110px";
	alertFram.style.textAlign = "center";
	alertFram.style.lineHeight = "150px";
	alertFram.style.zIndex = "300";
	strHtml = "<ul style=\"list-style:none;margin:0px;padding:0px;width:100%\">\n";
	strHtml += " <li style=\"background:#626262;text-align:left;padding-left:20px;font-size:14px;font-weight:bold;height:25px;line-height:25px;border:1px solid #F9CADE;color:white\">[中奖提醒]</li>\n";
	strHtml += " <li style=\"background:#787878;text-align:center;font-size:12px;height:95px;line-height:95px;border-left:1px solid #F9CADE;border-right:1px solid #F9CADE;color:#DCC722\">"+str+"</li>\n";
	strHtml += " <li style=\"background:#626262;text-align:center;font-weight:bold;height:30px;line-height:25px; border:1px solid #F9CADE;\"><input type=\"button\" value=\"确 定\" onclick=\"doOk()\" style=\"width:80px;height:20px;background:#626262;color:white;border:1px solid white;font-size:14px;line-height:20px;outline:none;margin-top: 4px\"/></li>\n";
	strHtml += "</ul>\n";
	alertFram.innerHTML = strHtml;
	document.body.appendChild(alertFram);
	document.body.appendChild(shield);
	this.doOk = function(){
		alertFram.style.display = "none";
		shield.style.display = "none";
	}
	alertFram.focus();
	document.body.onselectstart = function(){return false;}; */
}
</script>
</body>
</html>